/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <iostream>
#include <string>
using namespace std;

int main_1009_1()
{
    string sentence;
    getline(cin,sentence);
    string words[80];
    size_t pos=0,start=0,i=0;
    while ((pos=sentence.find(' ',pos))!=string::npos)
    {
        words[i++]=sentence.substr(start,pos-start);
        start=++pos;
    }
    words[i]=sentence.substr(start,string::npos-start);
    for (int i=79;i>0 ;--i )
    {
        if (words[i].length())
        {
            printf("%s ",words[i].c_str());
        }
    }
    printf("%s\n",words[0].c_str());
    return 0;
}
